﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using JLL.China.Infrastructure.Services;
using JLL.China.Model;
using JLL.China.Model.DTO;
using JLL.China.Web.Libraries;
namespace JLL.China.Web.Areas.Listings.Models
{

    public class ProjectDirectoryDetailModel
    {
        public Model.ProjectDirectoryDetail projectdir { get; set; }
        public Model.ProjectDirectoryDetail localprojectdir { get; set; }
    }
    // Project directory step2  

    

    //
    public class ProjectDirectoryModel
    {
        public ListingSearchCriteria _listingCriteria{get;set;}
        public int ListingID { get; set; }
        public int CountryID = HelperUtility.GetIdCountry();
        public int CountListing { get; set; }
        public ProjectDirectoryModel()
        {
            _listingCriteria = new ListingSearchCriteria();
        }
        private IList<Model.ProjectDirectory> ListingByStatus(ListingSearchCriteria _listingCriteria)
        {
            var listing = ProjectDirectoryService.Search(_listingCriteria);
            this.CountListing = listing.Count;
            return listing;
        }
        public IList<Model.ProjectDirectory> GetLocalByStatus(int? status)
        {
           // _listingCriteria.ListingType = "Resale";
            _listingCriteria.CountryID = CountryID;//China
            _listingCriteria.Status = status;
            //   _listingCriteria.ListingCat = "Admin";
            return ListingByStatus(_listingCriteria);
        }

        public IList<Model.ProjectDirectory> GetInternationalByStatus(int? status)
        {
            //_listingCriteria.ListingType = "Resale";
            _listingCriteria.CountryID = null;//
            _listingCriteria.Status = status;
            // _listingCriteria.ListingCat = "Admin";
            return ListingByStatus(_listingCriteria);
        }
       
    }
}
